/*
 * UAE - The Un*x Amiga Emulator
 *
 * Sound emulation stuff
 *
 * Copyright 1995, 1996, 1997 Bernd Schmidt
 */

#pragma once

#define PERIOD_MAX ULONG_MAX

extern void aud0_handler();
extern void aud1_handler();
extern void aud2_handler();
extern void aud3_handler();

extern void AUDxDAT(int nr, ushort value);
extern void AUDxDAT(int nr, ushort value, uae_ptr addr);
extern void AUDxVOL(int nr, ushort value);
extern void AUDxPER(int nr, ushort value);
extern void AUDxLCH(int nr, ushort value);
extern void AUDxLCL(int nr, ushort value);
extern void AUDxLEN(int nr, ushort value);

extern ushort audio_dmal();
extern void audio_state_machine();
extern uae_ptr audio_getpt(int nr, bool reset);

extern int init_audio();
extern void audio_reset();
extern void update_audio(bool evhandler = false);
extern void audio_evhandler();
extern void audio_hsync();
extern void audio_update_adkmasks();
extern void update_sound(double freq, int longframe, int linetoggle);
extern void led_filter_audio();
extern void set_audio();
extern void audio_vsync();

extern void audio_sampleripper(int);
extern int sampleripper_enabled;
extern void write_wavheader(struct zfile* wavfile, uint size, uint freq);

#define MIXED_STEREO_MAX 16
#define MIXED_STEREO_SCALE 32